function Sim(seed, DATA, PARAMS, OUT, market,version)

    close all
    format long g
    addpath('../helpers')
    addpath('../rcnl_demand')
    
    basic_parameters;

    k = floor((seed-1)/100)+1;
    seed = seed - 100*(k-1);

    if k<=length(strength_D)
        param_miss = k;
        fe_miss    = 0;
    elseif k>length(strength_D) & k< length(strength_D) + length(strength_X)
        param_miss = 1;
        fe_miss    = (k-length(strength_D))/(length(strength_X) - 1);
    end
    
    rng(seed);

    nmarkets = market;
    
    % Display market
    disp(market)
    
    [df, dfull] = load_data_full(DATA);
    
    [xi0, eta0, coefs0]  = load_parameters(fullfile(PARAMS, ['Reestimate',version,'_',int2str(param_miss),'.mat']));
    [df_sim, dfull_sim, coefs_sim] = data_simulate( ...
    xi0,      ...
    eta0,     ...
    coefs0,   ...
    df,       ...
    dfull,    ...
    nmarkets, ...
    fe_miss,  ...
    version,  ...
    seed      ...
    );

    save(fullfile(OUT, sprintf('sim_data_sim%d_%d_%d%s.mat', k, seed, market, version)), 'df_sim', 'dfull_sim', 'coefs_sim');
